//VERSION 1.0 - Flown on Mini Bexus 26. Sept 2012 to ~10km alt
//added HIL
void vx_svout()
{
  
  //mix for delta wing
  vx_svout_0 = vx_g_rcin_middle_0 - vx_g_stabilizeout_roll + vx_g_stabilizeout_nick ;
  vx_svout_1 = vx_g_rcin_middle_1 - vx_g_stabilizeout_roll - vx_g_stabilizeout_nick ;
  
  #if VX_SIM == VX_SIM_HIL
  vx_hil_svout_case++;
  if(vx_hil_svout_case == 50)
  {  
    vx_HILSendFlightControl();
    vx_hil_svout_case= 0;    
  }
  #endif
  
  
  APM_RC.OutputCh(0, vx_svout_0);         //Attention! Servo connector 1 is channel 0 => 0 to 7 is 1 to 8 
  APM_RC.OutputCh(1, vx_svout_1);
  APM_RC.OutputCh(2, APM_RC.InputCh(2));
  
  if(vx_g_launch_servo)
  {
    APM_RC.OutputCh(4, 1450);
  }
  else
  {
    APM_RC.OutputCh(4, 1950);
  }
  
  
  if(vx_g_smoker_state == 1)
  {
    APM_RC.OutputCh(5, 1720);
  }
  else if (vx_g_smoker_state == 2)
  {
    APM_RC.OutputCh(5, 1960);
  }
  else
  {
    APM_RC.OutputCh(5, 1140);
  }
  
  

};

